package org.helldorado.companybuilder;

import java.util.Map;

public class State extends TIPD {
	private static Map<Integer, TIPD> s_states; 
	
	private static Map<Integer, TIPD> getInstance() {
		if (s_states == null) {
			String sourceFile = "hd_states";
			String tag = "state";
			s_states = TIPD.getTipdFromFile(sourceFile, tag);
		}
		return s_states;
	}
	
	public static TIPD getStateById(Integer id) {
		TIPD ret = getInstance().get(id);
		if (ret == null){
			ret = new TIPD();
			ret.setTitle("State not found");
		}
		return ret;
	}
	
}
